package cn.t.web.industry;

import cn.t.facade.industry.IndustryOrderFacade;
import cn.t.vo.industry.IndustryAbnormalOrderVO;
import cn.t.vo.industry.IndustryHotSkuVO;
import cn.t.vo.industry.IndustryOrderVO;
import cn.t.vo.industry.IndustryReplenishmentOrderVO;
import cn.t.vo.industry.IndustryRsSkuVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *  - 领用单
 */
@Slf4j
@RestController
@RequestMapping("/industry/order")
@AllArgsConstructor
public class IndustryOrderController {

    private final IndustryOrderFacade industryOrderFacade;

    /**
     * 现场看板-最新领用记录查询接口
     */
    @GetMapping("/received")
    public List<IndustryOrderVO> getReceivedOrder(@RequestParam Integer count,Long firmId) {
        return industryOrderFacade.getReceivedOrder(count, firmId);
    }

    /**
     * 现场看板-最新领用异常记录查询接口
     */
    @GetMapping("/abnormal")
    public List<IndustryAbnormalOrderVO> getAbnormalReceivedOrder(@RequestParam Integer count,Long firmId) {
        return industryOrderFacade.getAbnormalReceivedOrder(count, firmId);
    }

    /**
     * 现场看板-补货单查询接口
     */
    @GetMapping("/replenishment")
    public IndustryReplenishmentOrderVO getReplenishmentOrder(@RequestParam Integer count, @RequestParam(required = false) Long firmId) {
        return industryOrderFacade.getReplenishmentOrder(count, firmId);
    }

    /**
     * 现场看板-待补货商品接口
     */
    @GetMapping("/replenishmentSku")
    public IndustryRsSkuVO getReplenishmentSku(@RequestParam Integer count, @RequestParam(required = false) Long firmId) {
        return industryOrderFacade.getReplenishmentSku(count, firmId);
    }

    /**
     * 现场看板-近60天热门领用商品
     */
    @GetMapping("/hotSku")
    public List<IndustryHotSkuVO> getHotSku(@RequestParam Integer count, @RequestParam(required = false) Long firmId) {
        return industryOrderFacade.getHotSku(count, firmId);
    }

}

